home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / amigae.jan.archive / 000059_crash!dtek.cha…ers.se!d2hacker_Tue, 25 Jan 94 01:05:54 PST.msg < prev    next >
Text File  |  1994-02-17  |  5KB  |  113 lines

  1. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  2.       id <1ng6@bkhouse.cts.com>; Tue, 25 Jan 94 01:05:54 PST
  3. Received: from hacke14.dtek.chalmers.se by crash.cts.com with smtp
  4.     (Smail3.1.28.1 #18) id m0pOUOl-0000LtC; Mon, 24 Jan 94 08:44 PST
  5. Received: from localhost (d2hacker@localhost) by hacke14.dtek.chalmers.se (8.6.4/8.6.4) id RAA09700 for AmigaE@bkhouse.cts.com; Mon, 24 Jan 1994 17:44:17 +0100
  6. Message-Id: <199401241644.RAA09700@hacke14.dtek.chalmers.se>
  7. Date: Mon, 24 Jan 1994 17:44:15 +0100 (MET)
  8. In-Reply-To: <m0pMyTj-0003X1C@multi.multiline.com.au> from "Rob Nottage" at Jan 20, 94 08:27:15 pm
  9. X-Mailer: ELM [version 2.4 PL22]
  10. MIME-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. Content-Length: 1826
  14. From: Magnus Hacker <d2hacker@dtek.chalmers.se>
  15. To: AmigaE@bkhouse.cts.com
  16. Subject: Re: Some Questions
  17.  
  18. >     3) Could someone show me a simple example of how to get input from
  19. >        a window once you open it. I know towrite to the screen you use
  20. >        TextF() instead of WriteF(). I can use ReadStr() to get input
  21. >        from, say, cli screens, but I can't find what to use from a 
  22. >        window that I have opened. I'm writng a little adventure game
  23. >        and want to input commands from the window I open.
  24.  
  25. Try this:
  26.  
  27. DEF handle,oldstd
  28.  
  29. IF (handle:=Open('CON:0/0/640/200/My Adventure Game',NEWFILE))
  30.  
  31.   oldstd:=SetStdOut(handle)
  32.   WriteF('Welcome to Zork XIV!\n')
  33.   /*
  34.    .
  35.    . (The game code. Use the same functions as for cli windows, i.e ReadStr())
  36.    .
  37.   */
  38.  
  39.   Close(handle)
  40.   SetStdOut(oldstd)
  41.   WriteF('So long!\n')
  42.  
  43. ENDIF
  44.  
  45. First, you open a file. The file is actually a console window and it behaves
  46. exactly like a cli window. The filename is 'CON:x/y/width/height/name'.
  47. Of course you have to check that the window actually opened. That is the
  48. reason for the IF statement.
  49.  
  50. Then you have to set the standard output handle to the handle of your newly
  51. opened window. SetStdOut() does this for you, and it returns the old
  52. standard output handle, in case you need it again.
  53.  
  54. Now you can use WriteF() and ReadStr() to your heart's content. Use Close()
  55. to close the window, not CloseW(). Re-set the standard output if you wish
  56. to make sure that output after the Close() call is sent to the cli window
  57. that you ran the program from. (The 'So long' in the code above will appear
  58. in your cli window)
  59.  
  60. Hope this helps,
  61.  
  62. +--------------------------------------------------+-------------------+
  63. | Magnus Hacker, Chalmers Univ. of Technology      |     This space    |
  64. | d2hacker@dtek.chalmers.se                        |      for rent     |
  65. +--------------------------------------------------+-------------------+
  66. From crash!kadewe.artcom.de!hans Tue, 25 Jan 94 01:06:03 PST
  67. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  68.       id <1ngb@bkhouse.cts.com>; Tue, 25 Jan 94 01:06:03 PST
  69. Received: from kadewe.artcom.de by crash.cts.com with smtp
  70.     (Smail3.1.28.1 #18) id m0pOUVj-0000KMC; Mon, 24 Jan 94 08:51 PST
  71. Received: by kadewe.artcom.de (/\==/\ Smail3.1.25.1 #25.3 MX/A)
  72.       id <m0pOUVg-0004flC@kadewe.artcom.de>; Mon, 24 Jan 94 17:51 MET
  73. Message-Id: <m0pOUVg-0004flC@kadewe.artcom.de>
  74. Date: Mon, 24 Jan 1994 17:51:32 +0100
  75. Reply-To: hans@artcom.de
  76. X-Mailer: Mail User's Shell (7.2.5 10/14/92)
  77. From: hans@kadewe (Hans H. Huebner)
  78. To: AmigaE%bkhouse@crash.cts.com
  79. Subject: Please unsubscribe franke@kadewe.artcom.de from the Amiga Mailing List
  80.  
  81. The subject says it all.  Please remove that user from the Mailing list.
  82.  
  83. Thanks - Hans (postmaster@artcom.de)
  84.  
  85. -- 
  86. Hans H. Huebner                    ART+COM e.V
  87. Voice:    (+49-30) 262 94 01            Hardenbergplatz 2
  88. Fax  :  (+49-30) 261 90 36            10623 Berlin
  89. From crash!freenet.carleton.ca!ao443 Tue, 25 Jan 94 01:06:15 PST
  90. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  91.       id <1ngj@bkhouse.cts.com>; Tue, 25 Jan 94 01:06:15 PST
  92. Received: from freenet-news.carleton.ca by crash.cts.com with smtp
  93.     (Smail3.1.28.1 #18) id m0pOUZQ-00019nC; Mon, 24 Jan 94 08:55 PST
  94. Received: from freenet.carleton.ca by freenet-news.carleton.ca (4.1/SMI-4.0)
  95.     id AA20284; Mon, 24 Jan 94 11:55:05 EST
  96. Received: from localhost (ao443@localhost) by freenet.carleton.ca (8.6.4/8.6.4) id LAA22844; Mon, 24 Jan 1994 11:55:15 -0500
  97. Date: Mon, 24 Jan 1994 11:55:15 -0500
  98. Message-Id: <199401241655.LAA22844@freenet.carleton.ca>
  99. Reply-To: ao443@freenet.carleton.ca
  100. From: ao443@freenet.carleton.ca (Jason Maskell)
  101. To: amigae@bkhouse.cts.com
  102. Subject: Subscription problems..
  103.  
  104.  
  105.    I seem to be getting two copies of every message on the list.. Do I
  106. have two subscriptions or something?
  107.  
  108.  
  109. --
  110. -------------------------------------------------------------------------
  111.  
  112. Claimer: My employers agree wholeheartedly with my every utterance.